/* SPDX-License-Identifier: GPL-2.0+ */

stdin=serial
stdout=serial
stderr=serial
#ifdef CONFIG_VIDEO
stdout+=,vidconsole
stderr+=,vidconsole
#endif
baudrate=115200
ethaddr=E4:C3:2A:5C:4E:50
eth6addr=E4:C3:2A:5C:4E:50
serial#=22094Y9005682
serverip=192.168.0.66
ipaddr=192.168.0.2
kernel_addr=0xbc050000
loadaddr=0x81000000
bootm_size=0x7b0000
autoload=n
updatefile=tp_recovery.bin
bootargs=console=ttyS0,115200
autostart=n
autoboot=y
bootcmd= \
echo "=================================="; \
echo "===== Check if RESET pressed ====="; \
echo "=================================="; \
if gpio input PB6; then \
  gpio set PB8; \
  echo "Start loading the firmware into the memory..."; \
  if tftpboot ${loadaddr} ${updatefile}; then \
  else reset; \
  fi; \
  echo "Start erasing the firmware space..."; \
  if sf probe; then \
  else reset; \
  fi; \
  if sf erase 0x50000 +0x7b0000; then \
  else reset; \
  fi; \
  echo "Start reflashing the router..."; \
  if sf write ${loadaddr} 0x50000 ${filesize}; then \
  else reset; \
  fi; \
  echo "Reboot the router..."; \
  reset; \
fi; \
gpio clear PB8; \
gpio set PB10; \
bootm ${kernel_addr};
